import FileIcon from "./fileIcon";
import opentypeJs from 'opentype.js';
let fontFileUrl = '/fonts/Roboto-Bold.ttf';
export default {
	install(Vue, options) {
		let loadedFont = Vue.prototype.$fontInstance;
		if (!loadedFont) {
			opentypeJs.load(fontFileUrl).then(font => {
				Vue.prototype.$fontInstance = font;
			}).catch(error => {
				console.error('字体加载失败:', error);
				throw error;
			});
		} else {
			Vue.prototype.$fontInstance = loadedFont;
		}
		Vue.component(FileIcon.name, FileIcon);
	}
}